﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.PageObjects;

namespace GmailAuto
{
    public static class Browser
    {
        private static IWebDriver driver;

        public static IWebDriver Driver()
        {
            driver = driver ?? new FirefoxDriver();
            return driver;
        }

        public static void Close()
        {
            //if(driver != null) driver.Quit();
        }

        static readonly Finalizer finalizer = new Finalizer();
        sealed class Finalizer
        {
            ~Finalizer()
            {
                Close();
            }
        }
    }
}
